#include <iostream>
#include <vector>

using namespace std;

bool isPowerOfTwo(long long x) {
    return x != 0 && (x & (x - 1)) == 0;
}

int countNumbersToDelete(int n, vector<long long>& numbers) {
    int count = 0;
    for (long long num : numbers) {
        if (isPowerOfTwo(num)) {
            count++;
        }
    }
    return count;
}

int main() {
    int n;
    cin >> n;
    vector<long long> numbers(n);
    for (int i = 0; i < n; i++) {
        cin >> numbers[i];
    }
    cout << countNumbersToDelete(n, numbers) << endl;
    return 0;
}
